<template>
  <wanglei-count-to prefix="总金额" suffix="￥" :end-val="endVal">
  </wanglei-count-to>

  <wanglei-count-to :end-val="endVal">
    <template #left><b>总金额：</b></template>
    <template #right><em>元</em></template>
  </wanglei-count-to>
  <button @click="handleClick">增加</button>
</template>

<script>
import { defineComponent, ref } from 'vue'
export default defineComponent({
  setup() {
    const endVal = ref(100)

    const handleClick = () => {
      endVal.value += Math.random() * 100
    }

    return {
      endVal,
      handleClick
    }
  }
})
</script>

<style scoped>

</style>
